/* wangEditor 样式修复 */
.w-e-text-container h5, .w-e-text-container .h5 {
  font-size: 14px;
}
.w-e-text-container h4, .w-e-text-container .h4 {
  font-size: 16px;
  font-weight: bold;
}
.w-e-text-container h3, .w-e-text-container .h3 {
  font-size: 18px;
  font-weight: bold;
}
.w-e-text-container h2, .w-e-text-container .h2 {
  font-size: 20px;
  font-weight: bold;
}
.w-e-text-container h1, .w-e-text-container .h1 {
  font-size: 22px;
  font-weight: bold;
}
.w-e-text-container i {
  font-style: italic;
}
.w-e-toolbar .w-e-menu i {
  font-style: normal;
}
.w-e-text-container ol {
  margin: 10px 0 10px 22px;
  list-style-type: decimal;
}
.w-e-text-container ul {
  margin: 10px 0 10px 22px;
  list-style-type: disc;
}
.w-e-text-container table {
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
}
.w-e-text-container table td,
.w-e-text-container table th {
  border-bottom: 1px solid #ccc;
  border-right: 1px solid #ccc;
  padding: 3px 5px;
  height: 32px;
}
.w-e-text-container table th {
  border-bottom: 2px solid #ccc;
  text-align: center;
  background-color: #f1f1f1;
}
.w-e-text-container blockquote {
  display: block;
  border-left: 8px solid #d0e5f2;
  padding: 5px 10px;
  margin: 10px 0;
  line-height: 1.4;
  min-height: 24px;
  font-size: 100%;
  background-color: #f1f1f1;
}
.w-e-text-container code {
  display: inline-block;
  background-color: #f1f1f1;
  border-radius: 3px;
  padding: 3px 5px;
  margin: 0 3px;
}
.w-e-text-container pre code {
  display: block;
}
.w-e-text-container a {
  color: #5592e5;
}
/* 取消对所有 span 的全局字体覆盖，避免标题加粗后被降级为小字号 */
/* 如需正文默认样式，请针对 p/li 设置，而非全局 span */

/* 确保标题内被包裹的元素继承字号与行高 */
.w-e-text-container h1 span,
.w-e-text-container h2 span,
.w-e-text-container h3 span,
.w-e-text-container h4 span,
.w-e-text-container h5 span,
.w-e-text-container h1 strong,
.w-e-text-container h2 strong,
.w-e-text-container h3 strong,
.w-e-text-container h4 strong,
.w-e-text-container h5 strong,
.w-e-text-container h1 b,
.w-e-text-container h2 b,
.w-e-text-container h3 b,
.w-e-text-container h4 b,
.w-e-text-container h5 b {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* 额外的 wangEditor 样式修复 */
.w-e-text-container img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0;
}

/* 确保居中对齐的图片正确显示 */
.w-e-text-container .text-center img,
.w-e-text-container p.text-center img,
.w-e-text-container div.text-center img {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 针对wangEditor生成的居中图片样式 */
.w-e-text-container p[style*="text-align: center"] img,
.w-e-text-container div[style*="text-align: center"] img,
.w-e-text-container p[style*="text-align:center"] img,
.w-e-text-container div[style*="text-align:center"] img {
  margin-left: auto !important;
  margin-right: auto !important;
}

.w-e-text-container hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 20px 0;
}

.w-e-text-container p {
  margin: 10px 0;
  line-height: 1.6;
  font-family: PingFang SC,Lantinghei SC,Helvetica Neue,Helvetica,Arial,Microsoft YaHei,微软雅黑,STHeitiSC-Light,simsun,宋体,WenQuanYi Zen Hei,WenQuanYi Micro Hei,"sans-serif";

}

.w-e-text-container strong {
  font-weight: bold;
}

.w-e-text-container em {
  font-style: italic;
}

.w-e-text-container del {
  text-decoration: line-through;
}

.w-e-text-container u {
  text-decoration: underline;
}

.w-e-text-container sub {
  vertical-align: sub;
  font-size: smaller;
}

.w-e-text-container sup {
  vertical-align: super;
  font-size: smaller;
}

/* 确保编辑器工具栏样式正常 */
.w-e-toolbar {
  border-bottom: 1px solid #ccc;
  background-color: #fff;
}

.w-e-toolbar .w-e-menu {
  border: none;
}

.w-e-toolbar .w-e-menu:hover {
  background-color: #f1f1f1;
}

/* 编辑器内容区域样式 */
.w-e-text-container {
  padding: 4px;
  min-height: 300px;
  line-height: 1.6;
}

/* 确保编辑器在暗色主题下的兼容性 */
@media (prefers-color-scheme: dark) {
  .w-e-text-container {
    background-color: #fff;
    color: #000;
  }
  
  .w-e-toolbar {
    background-color: #fff;
    border-bottom-color: #ccc;
  }
}

/* 视频样式 - 默认居中显示 */
.w-e-text-container video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 确保居中对齐的视频正确显示 */
.w-e-text-container .text-center video,
.w-e-text-container p.text-center video,
.w-e-text-container div.text-center video {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 针对wangEditor生成的居中视频样式 */
.w-e-text-container p[style*="text-align: center"] video,
.w-e-text-container div[style*="text-align: center"] video,
.w-e-text-container p[style*="text-align:center"] video,
.w-e-text-container div[style*="text-align:center"] video {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 视频容器样式 */
.w-e-text-container video[style*="display: block"] {
  margin-left: auto !important;
  margin-right: auto !important;
}

.w-e-text-container audio {
  width: 100%;
  margin: 10px 0;
}

.w-e-text-container iframe {
  max-width: 100%;
  border: none;
  margin: 10px 0;
}

/* 任务列表样式 */
.w-e-text-container input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
}

.w-e-text-container .task-list-item {
  list-style: none;
  margin: 5px 0;
}

.w-e-text-container .task-list-item input[type="checkbox"] {
  margin-right: 8px;
}

/* 数学公式样式 */
.w-e-text-container .math {
  text-align: center;
  margin: 10px 0;
}

.w-e-text-container .math-inline {
  display: inline;
  margin: 0 2px;
}

/* 高亮文本样式 */
.w-e-text-container mark {
  background-color: #ffeb3b;
  padding: 2px 4px;
  border-radius: 2px;
}

/* 小字体样式 */
.w-e-text-container small {
  font-size: 0.875em;
}

/* 大字体样式 */
.w-e-text-container big {
  font-size: 1.25em;
}

/* 自定义字体大小样式 */
.w-e-text-container [style*="font-size: 17px"] {
  font-size: 17px !important;
}

.w-e-text-container [style*="font-size: 18px"] {
  font-size: 18px !important;
}

/* 确保字体大小样式正确应用 */
.w-e-text-container span[style*="font-size: 17px"],
.w-e-text-container p[style*="font-size: 17px"],
.w-e-text-container div[style*="font-size: 17px"] {
  font-size: 17px !important;
}

.w-e-text-container span[style*="font-size: 18px"],
.w-e-text-container p[style*="font-size: 18px"],
.w-e-text-container div[style*="font-size: 18px"] {
  font-size: 18px !important;
}

/* 居中对齐 */
.w-e-text-container .text-center {
  text-align: center;
}

/* 右对齐 */
.w-e-text-container .text-right {
  text-align: right;
}

/* 左对齐 */
.w-e-text-container .text-left {
  text-align: left;
}

/* 两端对齐 */
.w-e-text-container .text-justify {
  text-align: justify;
}

/* 缩进样式 */
.w-e-text-container .indent-1 {
  text-indent: 2em;
}

.w-e-text-container .indent-2 {
  text-indent: 4em;
}

/* 行间距样式 */
.w-e-text-container .line-height-1 {
  line-height: 1;
}

.w-e-text-container .line-height-1-5 {
  line-height: 1.5;
}

.w-e-text-container .line-height-2 {
  line-height: 2;
}

/* 字间距样式 */
.w-e-text-container .letter-spacing-1 {
  letter-spacing: 1px;
}

.w-e-text-container .letter-spacing-2 {
  letter-spacing: 2px;
}

/* 确保编辑器内容区域的最小高度和滚动 */
.w-e-text-container {
  min-height: 300px;
  overflow-y: auto;
  word-wrap: break-word;
  word-break: break-word;
}

/* 编辑器工具栏按钮的激活状态 */
.w-e-toolbar .w-e-menu.w-e-active {
  background-color: #e6f7ff;
  border-color: #1890ff;
}

/* 编辑器工具栏按钮的禁用状态 */
.w-e-toolbar .w-e-menu.w-e-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 编辑器占位符样式 */
.w-e-text-container .w-e-text-placeholder {
  color: #999;
  position: absolute;
  top: 10px;
  left: 10px;
  pointer-events: none;
  user-select: none;
}

/* 编辑器选中文本的背景色 */
.w-e-text-container ::selection {
  background-color: #b3d4fc;
}

.w-e-text-container ::-moz-selection {
  background-color: #b3d4fc;
}